const http = require('http');
const url = require('url');
const querystring = require('querystring');

let server = http.createServer((request, response) => {
	// get
	let {pathname, query} = url.parse(request.url, true);
	
	// post
	let str = '';
	request.on('data', data => {
		str += data;
	});

	request.on('end', () => {
		let post = querystring.parse(str);
		// /aaa { z: '12', b: '50' } { user: 'admin', pwd: '123456' }
		console.log(pathname, query, post);
		
	})
})

server.listen(8080);